#include <iostream>
#include <string>
using namespace std;
class Sales_data{
friend Sales_data add(const Sales_data&,const Sales_data&);
friend istream &read(istream&,Sales_data&);
friend ostream &print(ostream&,const Sales_data&);
private:
	string bookNo;
	unsigned units_sold;
	double revenue;
	double avg_price() const{return units_sold?revenue/units_sold:0.0;}
public:
	//Sales_data()=default;
	// Sales_data(const string &s,unsigned n,double p):bookNo("default"),units_sold(0),revenue(0.0){
	// 	bookNo=s;
	// 	units_sold=n;
	// 	revenue=n*p;
	// }
	Sales_data(const string &s,unsigned n,double p):bookNo(s),units_sold(n),revenue(p*n){}
	Sales_data():Sales_data("",0,0){}
	Sales_data(const string s):Sales_data(s,0,0){}
	Sales_data(istream &is):Sales_data(){read(is,*this);}
	string isbn()const{return bookNo;}
	Sales_data& combine(const Sales_data&);
	
	
};
Sales_data add(const Sales_data&,const Sales_data&);
istream &read(istream&,Sales_data&);
ostream &print(ostream&,const Sales_data&);